import QtQuick 2.15

Rectangle {
    id: myItem

    property string videoFile: ""
    property string pictureFile: ""
    property string pictureName: ""

    width: 256

    Column {
        spacing: 5
        width: myItem.width

        Image {
            source: myItem.pictureFile
            width: myItem.width
            fillMode: Image.PreserveAspectFit
            height: 310

            CoverLabel {
                width: parent.width
                anchors.bottom: parent.bottom
            }

            MouseArea {
                anchors.fill: parent
                onPressed: {
                    // 处理鼠标点击事件
                    myModel.play(myItem.videoFile);
                }
            }

        }

        Text {
            text: myItem.pictureName
            width: myItem.width
            wrapMode: Text.WrapAnywhere
            font.pixelSize: 12
            font.wordSpacing: 2
            horizontalAlignment: Text.AlignLeftText
            font.capitalization: Font.AllLowercase
            font.weight: Font.ExtraLight
        }

    }

}
